<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>预约成功</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../../css/mui.min.css">
		<link rel="stylesheet" href="../../css/app.css">
		<style>
			.mui-content{margin-top: .25rem;}
			.reserve_top{background:#fff url(../../images/jindu/yy_bian.png) no-repeat;background-size:100% auto;background-position:left bottom;width:6.7rem;overflow:hidden;
			margin:0 auto 0 auto;text-align:center;border-radius:.15rem .15rem 0 0;}
			.reserve_top>img{width:3.46rem;margin:.25rem auto .1rem auto;}
			.reserve_top>p{margin:0;width:100%;float:left;text-align:center;color:#fc9b10;font-size:.36rem;margin: 0 0 .5rem 0;}
			.reserve_bottom{width:6.7rem;margin:-.02rem auto 0 auto;border-radius:0 0 .15rem .15rem;background:#fff;padding:.27rem 0 .3rem 0;}
			.reserve_bottom>.reserve_list{width:6.3rem;overflow:hidden;margin:0 auto;font-size:.3rem;line-height:.5rem;}
			.reserve_bottom .cancel_reserve{width:6.3rem;overflow:hidden;margin:.55rem auto .3rem auto;font-size:.3rem;color:#999;line-height:.5rem;}
			.reserve_bottom .mui-btn{width:5.55rem;overflow:hidden;margin:.2rem auto 0 .55rem;height:.8rem;line-height:.8rem;padding:0;font-size:.32rem;border-radius:1rem;}
		</style>
	</head>
	<body>
			<div class="mui-content">
				<div class="reserve_top">
					<img src="../../images/jindu/success.png">
					<p>预约成功</p>
				</div>
				<div class="reserve_bottom">
					<div class="reserve_list">
						<label>事项名称：</label>
						<span id="sxmc"></span>
					</div>
					<div class="reserve_list">
						<label>预约时间：</label>
						<span id="yysj"></span>
					</div>
					<div class="reserve_list">
						<label>预约地址：</label>
						<span id="yydz"></span>
					</div>
					<div class="cancel_reserve">如果您想取消本次预约，请登录用户中心，在我的预约列表中进行取消预约操作。您可以将预约信息发送到手机上，<a class="blue">点击发送</a></div>
					<div style="margin:.2rem auto 0 .55rem;height:.8rem;"></div>
					<div style="margin:.2rem auto 0 .55rem;height:.8rem;"></div>
				</div>
			</div>
	</body>
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/common.js"></script>
	<script>
		var recId = "";
		var phoneNum = "";
		mui.plusReady(function() {
			//获取上一个页面传过来的参数开始
			recId = utils.getUrlParam('recId');
			loadRec(recId);
		});
		
		/**
		 * 加载信息
		 * @param {Object} recId 预约主键
		 */
		function loadRec(recId) {
			var param = 'recId=' + recId;
			var url = 'appHttpService/appOnlineBookingSuccess.do';
			utils.ajax(url, function(data) {
				data = JSON.parse(data);
				if(data.code == 0) {
					var appRec = data.appRec;
					var appLocation = data.appLocation;
					phoneNum = appRec.phoneNum;
					document.getElementById('sxmc').innerText = data.sxServiceName;
					document.getElementById('yysj').innerText = utils.format(appRec.bookingDay,"yyyy-MM-dd") + " " + appRec.bookingTime;
					document.getElementById('yydz').innerText = data.locationAddr+",携带身份证到现场取号办理。";
				}
			}, param);
		};
		
		/**
         * 点击大项展示办理项或者小项
         */
		mui(".cancel_reserve").on('tap','a',function(){
			if(recId != '' && phoneNum != ''){
				sendPhoneMsg(phoneNum,recId);
			}
        })
		
	    //点击发送短信
		function sendPhoneMsg(phone,oid){
			utils.showWaiting();
			var param = 'oid=' + oid+'&phone='+phone;
			var url = 'appHttpService/appOnlineBookingSend.do';
			utils.ajax(url, function(data) {
				data = JSON.parse(data);
				if(data.code == 0) {
					mui.toast('信息发送成功，请注意查收！');
				}
				utils.closeWaiting();
			}, param);
		}
	</script>
	
</html>
